//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.

package org.ryzom.nel.misc;

public class CBufFIFO {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CBufFIFO(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CBufFIFO obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nelmiscJNI.delete_CBufFIFO(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CBufFIFO() {
    this(nelmiscJNI.new_CBufFIFO(), true);
  }

  public void push(SWIGTYPE_p_std__vectorT_unsigned_char_t buffer) {
    nelmiscJNI.CBufFIFO_push__SWIG_0(swigCPtr, this, SWIGTYPE_p_std__vectorT_unsigned_char_t.getCPtr(buffer));
  }

  public void push(CMemStream buffer) {
    nelmiscJNI.CBufFIFO_push__SWIG_1(swigCPtr, this, CMemStream.getCPtr(buffer), buffer);
  }

  public void push(SWIGTYPE_p_unsigned_char buffer, long size) {
    nelmiscJNI.CBufFIFO_push__SWIG_2(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(buffer), size);
  }

  public void push(SWIGTYPE_p_std__vectorT_unsigned_char_t buffer1, SWIGTYPE_p_std__vectorT_unsigned_char_t buffer2) {
    nelmiscJNI.CBufFIFO_push__SWIG_3(swigCPtr, this, SWIGTYPE_p_std__vectorT_unsigned_char_t.getCPtr(buffer1), SWIGTYPE_p_std__vectorT_unsigned_char_t.getCPtr(buffer2));
  }

  public void front(SWIGTYPE_p_std__vectorT_unsigned_char_t buffer) {
    nelmiscJNI.CBufFIFO_front__SWIG_0(swigCPtr, this, SWIGTYPE_p_std__vectorT_unsigned_char_t.getCPtr(buffer));
  }

  public void front(CMemStream buffer) {
    nelmiscJNI.CBufFIFO_front__SWIG_1(swigCPtr, this, CMemStream.getCPtr(buffer), buffer);
  }

  public void front(SWIGTYPE_p_p_unsigned_char buffer, SWIGTYPE_p_unsigned_int size) {
    nelmiscJNI.CBufFIFO_front__SWIG_2(swigCPtr, this, SWIGTYPE_p_p_unsigned_char.getCPtr(buffer), SWIGTYPE_p_unsigned_int.getCPtr(size));
  }

  public short frontLast() {
    return nelmiscJNI.CBufFIFO_frontLast(swigCPtr, this);
  }

  public void pop() {
    nelmiscJNI.CBufFIFO_pop(swigCPtr, this);
  }

  public void resize(long size) {
    nelmiscJNI.CBufFIFO_resize(swigCPtr, this, size);
  }

  public boolean empty() {
    return nelmiscJNI.CBufFIFO_empty(swigCPtr, this);
  }

  public void clear() {
    nelmiscJNI.CBufFIFO_clear(swigCPtr, this);
  }

  public long size() {
    return nelmiscJNI.CBufFIFO_size(swigCPtr, this);
  }

  public void display() {
    nelmiscJNI.CBufFIFO_display(swigCPtr, this);
  }

  public void displayStats(CLog log) {
    nelmiscJNI.CBufFIFO_displayStats__SWIG_0(swigCPtr, this, CLog.getCPtr(log), log);
  }

  public void displayStats() {
    nelmiscJNI.CBufFIFO_displayStats__SWIG_1(swigCPtr, this);
  }

}
